<?php
class CMRPageSessionHistory extends CMRPage
{
protected function getContentsDiv()
	{
		$html = "<div id=\"content\">\n";
		$html .= "<h1>Session History</h1>";

		$sectionsPanel = new SectionsPanel('');
		$html .= $sectionsPanel->getHTML();

		$shortcutPanel = new ShortcutPanel('');
		$html .= $shortcutPanel->getHTML();
		
		
//		echo $this->getSubAction();

		$sql = "SELECT * from UserSessions ORDER BY Expires DESC";
		$this->Database->ExecuteSQL($sql);
		$html .= "<div id=\"usersessionlist\"><table>\n";
		while($row=$this->Database->getRow())
		{
			$date = new DateTime($row['Expires']);
			$html .= "<tr><td>".$row['Username']."</td><td>".$date->format("D j M Y H:i")."</td><td>".$row['SessionID']."</td></tr>\n";
		}
		$html .= "</table></div>\n";
		
	
		$html .= "</div>\n";
		return $html;
	}
}
				
